home *** CD-ROM | disk | FTP | other *** search
- Path: news.ios.com!usenet
- From: vlad@gramercy.ios.com (vlad)
- Newsgroups: comp.lang.c++
- Subject: Re: prob. exporting functions in Borland C++ into DLL
- Date: Sat, 20 Jan 1996 00:48:00 GMT
- Organization: Internet Online Services
- Message-ID: <4dpdtb$1rs@news.ios.com>
- References: <4dl117$ace@news.danadata.dk>
- NNTP-Posting-Host: ppp-41.ts-7.hck.idt.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- televis@aix1.danadata.dk (Thomas Zaschke) wrote:
-
- >My problem:
-
- >I am writing a Windows-DLL (16-bit), to be used by a non-C application.
- >All my sources are compiled with Borlands C++ compiler from within
- >Borland C++ 4.53. All extensions are *.cpp.
-
- >I want to export a function "MyFunc".
-
- >1) When using "_export" before the function-name, the resulting DLL does
- >not
- >content the name "MyFunc" as i would expect, but something like
- >"MyFunc$QV".
-
- >2) When using a .def file and exporting "MyFunc" explicitly, i get this
- >error
- >message "Attempt to export non-public symbol <myfunction-name>".
-
- >I do not experience these problems when compiling and linking pure
- >C-source.
-
- >My question is:
-
- >How can I export "MyFunc" in a DLL and be sure that other applications
- >actually can see the correct name: "MyFunc" ?
-
- >If I am forced to use a .def file (to export by ordinal), how do I get
- >this
- >to work without the before mentioned error ?
-
-
- try this:
- ~~~~~
-
- extern "C" MyFunc()
- {
- ...your code;
- }
-
- *******************************************
- * Vlastimil Adamovsky *
- * Smalltalk and C++ development *
- *******************************************
-
-